<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../../images/favicon.ico">
	<!-- 引入header -->
    <include file="Public/header" />
    <!-- 结束 -->
  
  <!-- Main Navbar -->
  <div class="main-nav">  	
	   <nav class="navbar navbar-expand-lg">
          <div class="collapse navbar-collapse" id="navbarNavDropdown">
            <ul class="navbar-nav">
              <li class="nav-item ">
                <a class="nav-link" href="/admin.php"><span class="active-item-here"></span><i class="fa fa-dashboard mr-5"></i> <span>仪表盘</span></a>
              </li>
              <li class="nav-item dropdown active">

                <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  <i class="fa fa-th mr-5"></i> <span class="active-item-here"></span><span>应用中心</span>
                </a>                  
                <ul class="dropdown-menu multilevel scale-up-left">
                	<li class="nav-item"><a class="nav-link" href="{:U('tools/index')}">应用管理</a></li>
                	<li class="nav-item"><a class="nav-link" href="{:U('tools/add')}">新增应用</a></li>     
                	<li class="nav-item"><a class="nav-link" href="{:U('tools/classe')}">分类管理</a></li> 
                  <li class="nav-item"><a class="nav-link" href="{:U('tools/link')}">友链管理</a></li>
                  <li class="nav-item"><a class="nav-link active" href="{:U('tools/menu')}">导航管理</a></li>            
                </ul>                 
              </li> 
              
              <li class="nav-item dropdown m-menu m-fix">
                <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  <i class="fa fa-table mr-5"></i> <span>系统设置</span>
                </a>
                <div class="dropdown-menu menu-mega mega-menu-auto scale-up-left">
                    <ul class="dropdown-menu multilevel scale-up-left">
                        <li>
                            <a class="nav-link" href="{:U('system/index')}" title=""><i class="fa fa-creative-commons mr-15"></i>基础设置</a>
                        </li>
                        <li>
                            <a class="nav-link" href="{:U('system/upinfo')}" title=""><i class="fa fa-address-card-o mr-15"></i>信息修改</a>
                        </li>
                        <li>
                            <a class="nav-link" href="{:U('system/temp')}" title=""><i class="fa fa-cubes mr-15"></i>模板设置</a>
                        </li>
                       <!--  -->
                    </ul><!-- /.menu-mega-child one-four -->
                          
                    
                </div>
                  
              </li>
              
              <li class="nav-item dropdown m-menu">
                <a class="nav-link" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  <i class="fa fa-laptop mr-5"></i> <span>应用商店</span>
                </a>
                <div class="dropdown-menu menu-mega scale-up-down">
                  
                    
                </div>
                  
              </li>               
              <li class="nav-item dropdown">
                <a class="nav-link" href="{:U('update/index')}">
                  <i class="fa fa-puzzle-piece mr-5"></i>检查更新
                </a>
              </li>
               
            </ul>
          </div>
        </nav>  	  
  </div>

  

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        管理你网站的首页导航
      </h1>
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="/admin.php"><i class="fa fa-dashboard"></i> 仪表盘</a></li>
        <li class="breadcrumb-item"><a href="#">应用中心</a></li>
        <li class="breadcrumb-item active">导航管理</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
    	
      <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">导航管理</h3>
            </div>
            <div class="box-header with-border">
            <a href="{:U('tools/menuadd')}" class="btn btn-outline btn-rounded btn-info">新增一个导航</a>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
				<div class="table-responsive">
				  <table id="example1" class="table table-bordered table-striped">
					<thead>
						<tr>
							<th><span class="badge badge-primary">ID</span></th>
							<th><span class="badge badge-info">导航名称</span></th>
							<th><span class="badge badge-warning">导航链接</span></th>
              <th><span class="badge badge-secondary">导航描述</span></th>
							<th><span class="badge badge-danger">操作</span></th>
						</tr>
					</thead>
					<tbody>
						<volist name="list" id="vo">
						<tr>
							<td>{$vo.id}</td>
							<td>{$vo.menu}</td>
							<td><a href="{$vo.link}" target="_blank">{$vo.link}点击查看该站点</a></td>
              <td>{$vo.descc}</td>
							 <td>
								<a href="{:U('tools/menuedit')}?id={$vo.id}" class="btn btn-outline btn-rounded btn-primary">编辑</a>
                <a href="javascript:void(0)" onClick="ty_del(this,'{$vo.id}')"  class="btn btn-outline btn-rounded btn-danger">删除</a>
							</td>
						</tr>
						</volist>
						
					</tbody>
					
				  </table>
				</div>
            </div>
            <!-- /.box-body -->
          </div>
      
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  
	<include file="Public/footer" />
	<script src="__PUBLIC__/Admin/js/layer/layer.js"></script>
	<script src="__PUBLIC__/Admin/vendor_components/datatable/datatables.min.js"></script>
	
	<!-- Fab Admin for Data Table -->
	<script src="__PUBLIC__/Admin/vendor_components/data-table.js"></script>
	<script type="text/javascript">
		function ty_del(obj, id) {
            var id = id;
            layer.confirm('确定要删除该导航吗？注意此操作不可逆！', function (index) {

                $.ajax({
                    type: 'POST',
                    url: '{:U('tools/menudel')}',
                    dataType: 'json',
                    data: { id: id},
                    success: function (data) {
                        console.log(data);
                        if (data.status == '1') {
                            layer.msg(data.info);//layer.msg('不开心。。', {icon: 5});
                            window.location.reload();
                        } else {
                            layer.msg(data.info);
                        }
                    },
                    error: function (data) {
                        layer.msg(data.info);
                    },
                });
            });
        }
	</script>
</body>
</html>
